import xadmin
from .models import CityDict
from .models import CourseOrg
from .models import Teacher


class CityDictAdmin(object):
    list_display = ['name', 'desc', 'createUser', 'create_time', 'deleted']
    search_fields = ['name', 'desc', 'createUser']
    list_filter = ['name', 'desc', 'createUser', 'create_time', 'deleted']


class CourseOrgAdmin(object):
    list_display = ['name', 'desc', 'click_num', 'fav_nums', 'address', 'city', 'createUser', 'create_time', 'deleted']
    search_fields = ['name', 'desc', 'click_num', 'fav_nums', 'address', 'city', 'createUser']
    list_filter = ['name', 'desc', 'click_num', 'fav_nums', 'address', 'city', 'createUser', 'create_time', 'deleted']


class TeacherAdmin(object):
    list_display = ['orgId', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_num', 'fav_nums',
                    'createUser', 'create_time', 'deleted']
    search_fields = ['orgId', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_num', 'fav_nums',
                     'createUser']
    list_filter = ['orgId', 'name', 'work_years', 'work_company', 'work_position', 'points', 'click_num', 'fav_nums',
                   'createUser', 'create_time', 'deleted']


xadmin.site.register(CityDict, CityDictAdmin)
xadmin.site.register(CourseOrg, CourseOrgAdmin)
xadmin.site.register(Teacher, TeacherAdmin)